Skip to content

Conversation

@AndrewSazonov
Copy link
Member

Fixes #30

@AndrewSazonov AndrewSazonov added this to the New API Stabilization milestone Sep 4, 2025
@AndrewSazonov AndrewSazonov added the [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) label Sep 4, 2025
@AndrewSazonov AndrewSazonov force-pushed the 30-refactor-default-constants branch from 381ac16 to fac8ed2 Compare September 5, 2025 10:11
@AndrewSazonov AndrewSazonov force-pushed the 30-refactor-default-constants branch from fac8ed2 to 7801bf8 Compare September 5, 2025 10:39
from .minimizers.minimizer_base import FitResults

if TYPE_CHECKING:
from .minimizers.minimizer_base import FitResults
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

circular dependencies? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change because Ruff showed a TC001 warning (“Move application imports used only for typing into a TYPE_CHECKING block”) after I turned on the type-checking rules 🙃

(ScatteringTypeEnum.TOTAL, BeamModeEnum.CONSTANT_WAVELENGTH): ['r (Å)', 'G(r) (Å)'],
(ScatteringTypeEnum.TOTAL, BeamModeEnum.TIME_OF_FLIGHT): ['r (Å)', 'G(r) (Å)'],
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's efficient!

'I', # Import sorting issues (e.g., unsorted imports)
'S', # Security-related issues (e.g., use of insecure functions or libraries)
'W', # General PEP 8 warnings (e.g., lines too long, trailing whitespace)
'TCH', # Type checking issues (e.g., incompatible types, missing type annotations)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do static type checking code analysis with ruff? Nice! Probably worth extending to other projects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Ruff has some basic type-checking support - it already helped catch one or two issues, and that's better than nothing. But we'll still need a more advanced solution, like typeguard or similar.

Copy link
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AndrewSazonov AndrewSazonov merged commit c280be5 into develop Sep 5, 2025
3 checks passed
@AndrewSazonov AndrewSazonov deleted the 30-refactor-default-constants branch September 5, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants